﻿/*  ----------------------------------------------------------------------------
 *  Microsoft Public License (http://www.microsoft.com/opensource/licenses.mspx#Ms-PL)
 *  
 *  ----------------------------------------------------------------------------
 *  DynamicAspect
 *  ----------------------------------------------------------------------------
 *  File:       Target.cs
 *  Author:     NiceWk (n9walker@hotmail.com)
 *  ----------------------------------------------------------------------------
 */

namespace Bizall.Dynamic.Aspect
{
    /// <summary>
    /// A helper can be used in filter target type by add these patterns to the <see cref="IAspect.Targets"/> collection of <see cref="AspectBase"/>'s children class.
    /// </summary>
    public static class TargetPattern
    {
        public const string ALL = @"(\w+)?";

        public static string StartWith(string value)
        {
            return "^"+value + ALL+"$";
        }

        public static string EndWith(string value)
        {
            return "^"+ALL+value+"$";
        }

        public static string Contains(string value)
        {
            return "^"+ALL+value+ALL+"$";
        }
    }
}